import request from '@/utils/request'

// postbars search 贴吧查找
export function getPostBarList(data) {
  return request({
    url: '/postbars/search',
    method: 'post',
    data
  })
}

// postbars add 贴吧新增
export function addPostBar(data) {
  return request({
    url: '/postbars/add',
    method: 'post',
    data
  })
}

// postbars ${id} 贴吧查找
export function getPostBarById(id) {
  return request({
    // url: `/postbars/${id}`,
    url: `/postbars`,
    method: 'get'
  })
}

// postbars clickLike/${id} 贴吧点击喜欢
export function like(id) {
  return request({
    // url: `/postbars/clickLike/${id}`,
    url: `/postbars/clickLike`,
    method: 'get'
  })
}

// 回帖操作
export function addReply(data) {
  return request({
    url: '/replies/add',
    method: 'post',
    data
  })
}

// 查询回帖
export function searchReply(data) {
  return request({
    url: '/replies/search',
    method: 'post',
    data
  })
}

// 评论
export function addComment(data) {
  return request({
    url: '/comments/add',
    method: 'post',
    data
  })
}
